<template>
	<view>
		<cu-custom  bgColor="bg-black-two"  :isBack="true">
			<block slot="content">大定制</block>
		</cu-custom>
		<view class="nft-block">
			<view class="block-view">
				<view class="title">标准需求</view>
				<select-tree @choose='choose' ></select-tree>
				<view class="line"></view>
				<view style="padding-bottom: 10px;">
					<view class="input-row-box">
						<view class="lable">姓名</view>
						<view class="input-box">
							<input class="input-content" v-model="name" placeholder="姓名" placeholder-style="color:#999" />
						</view>
						<view class="clear"></view>
					</view>
					
					<view class="input-row-box">
						<view class="lable">联系方式</view>
						<view class="input-box">
							<input class="input-content" v-model="phone" placeholder="联系方式"  placeholder-style="color:#999"/>
						</view>
						<view class="clear"></view>
					</view>
					
					<view class="input-row-box">
						<view class="lable">公司名称</view>
						<view class="input-box">
							<input class="input-content" v-model="officeName" placeholder="公司名称"  placeholder-style="color:#999"/>
						</view>
						<view class="clear"></view>
					</view>
					
					<view class="input-row-box">
						<view class="lable">职务</view>
						<view class="input-box">
							<input class="input-content" v-model="deptName" placeholder="职务"  placeholder-style="color:#999"/>
						</view>
						<view class="clear"></view>
					</view>
					
					<view class="input-row-box">
						<view class="lable">我的需求</view>
						<view class="input-box" style="height: 100px;">
							<!-- <input class="input-content" /> -->
							<textarea v-model="desc" style="width:95%;height: 95%;margin-top: 5px;text-align: left;margin-left: 10px;" placeholder="需求"  placeholder-style="color:#999"/>
						</view>
						<view class="clear"></view>
					</view>
					
				</view>
			</view>
			<view class="padding flex flex-direction">
				<button @click="getServerData()" class="cu-btn round margin-tb-xs lg" style="background: #00A99D;color: #FFF;">确认</button>
			</view>
		</view>
	</view>
</template>

<script>
	import selectTree from '@/components/DLHTX-select_tree/DLHTX-select_tree.vue'
	export default {
		components:{
			selectTree
		},
		data() {
			return {
				name:'',
				phone:'',
				officeName:'',
				deptName:'',
				desc:''
			}
		},
		onLoad() {
		},
		onShow() {
		},
		methods: {
			choose(e){
			    console.log(e);
			},
			async getServerData(){
				uni.showLoading({
					title:'正在提交..',
					mask:true
				})
				//新增
				let [err,res] = await this.$http.post('addDesc',{
					name:this.name,
					phone:this.phone,
					office_name:this.officeName,
					dept_name:this.deptName,
					desc_info:this.desc
				},{
					token:true,
					checkToken:true ,
				});
				// 失败
				if (!this.$http.errorCheck(err,res)){
					uni.hideLoading();
					return false;
				}
				uni.hideLoading();
				uni.showToast({
				    title: '提交成功',
				});
				setTimeout(function () {
				    uni.hideToast();
					uni.navigateBack({
						delta:1
					})
				}, 2000);
			}
		}
	}
</script>

<style>
	.nft-block {
		padding-top: 15px;
		width: 100%;
		background-color: #171723;
		color: #000;
	}
	
	.block-view {
		width: 90%;
		margin: 0 auto;
		border-radius: 10px;
		padding-top: 10px;
		background: #FFFFFF;
	}
	
	.title {
		width: 95%;
		font-size: 16px;
		color: #00A99D;
		margin: 0px auto;
	}
	
	.line {
		width:90%;
		margin:10px auto;
		height: 2px;
		background-color: #C8C8C8; 
	}
	
	.input-row-box {
		width: 100%;
		padding: 5px 20px;
	}
	
	.lable {
		float: left;
		height: 35px;
		line-height: 35px;
	}
	
	.input-box {
		width:75%;
		float: right;
		background-color: #F2F2F2;
		height: 35px;
		line-height: 35px;
		border-radius: 5px;
	}
	
	.input-content {
		height: 35px;
		line-height: 35px;
		text-align: left;
		margin-left: 10px;
	}
	

	.clear {
		clear: both;
	}

</style>
